o = open 'data.xml','w'
o.puts '<?xml version="1.0" encoding="gb18030"?><data>'
listjss = (1..3000).to_a
listjss.each{|e|
		p = 'data\\'+e.to_s+'.js'
		next unless File.exist?(p)
		
		o.printf "<item>\n"
		open(p).readlines.each{|line|
			next if line =~/mimg/
			next if line =~/mno/
			next if line =~/mdescription/
			ss = line.split '"'
			ss[0] = ss[0].chop
			ss[1] = ss[1].delete '<>'
			ss[0] = 'id' if line=~/mname/
			o.printf "  <%s>%s</%s>\n",ss[0],ss[1],ss[0]
		}
		o.puts '  <js>'
		p = 'data\\'+e.to_s+'list.js'
		a = []
		open(p).readlines.each{|line|
			if line =~/mnos/
				ss = line.chop.delete('mnos[]').split('=')
				a[ss[0].to_i]=ss[1]
			end
		}
		a[0]=a.length-1
		i = 0
		a.each{|e|
			a[i]='0' if e==nil
			i = i+1
		}
		i = 0
		a.each{|e|
			puts 'nil' if e==nil
			o.printf "    <j>%i,%s</j>\n",i,e
			i = i+1
		}
		o.puts '  </js>'
		
		o.printf "</item>\n"
}
o.puts '</data>'